Re: [SQL] Re: [GENERAL] Determining if "in a text set"

Поиск
Список
Период
Сортировка
От Herouth Maoz
Тема Re: [SQL] Re: [GENERAL] Determining if "in a text set"
Дата
Msg-id l0311070db32419557de6@[147.233.148.142]
обсуждение исходный текст
Ответ на Re: [GENERAL] Determining if "in a text set"  (Herouth Maoz <herouth@oumail.openu.ac.il>)
Ответы Re: [SQL] Re: [GENERAL] Determining if "in a text set"  (Richi Plana <richip@mozcom.com>)
Список pgsql-sql
At 19:24 +0200 on 28/03/1999, I  wrote:


>
> If the spaces between the words in your phrase are not just plain spaces
> but can also be tabs etc, you will have to use the regexp version, and
> write something like '[ \t\r\f\n]' - though I'm less than sure that
> postgres's regular expressions support these. Can anyone tell us which
> regexp definition postgres uses?

OK, I looked into it more deeply. The regular expressions in postgres seem
to follow the rules in the 'regex(5)' manpage.

So, if the delimiters are not necessarily plain space characters, you could
match, using the '~' version, with '[[:space:]]' instead of ' '. Ugly, but
it matches also tabs and newlines.

At least it does on my solaris. I'm not sure whether this is or is not
OS-dependent.

As for the words in the field, which you said can have trailing spaces. If
these spaces also may be tabs or newlines, you should use rtrim with two
arguments, and the second argument is a string of all characters which need
removal from the end of the string. The point is, however, that you type in
an actual tab or an actual newline.

Hope you followed me so far.

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma




В списке pgsql-sql по дате отправления:

Предыдущее
От: Herouth Maoz
Дата:
Сообщение: Re: [GENERAL] Determining if "in a text set"
Следующее
От: Richi Plana
Дата:
Сообщение: Re: [SQL] Re: [GENERAL] Determining if "in a text set"